<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取兄弟节点</title>
</head>
<body>
    <p>打开控制台查看结果</p>
    <script>
        const getSiblings = (el) => [...el.parentNode.childNodes].filter(node => node !== el && node.nodeType !== 3);
        console.log(getSiblings(document.querySelector('head')))
    </script>
</body>
</html>